/*
 * @Author: Qimu
 * @Date: 2020-04-22 22:39:04
 * @LastEditors: Qimu
 * @LastEditTime: 2020-07-09 19:32:00
 * @Description: file content
 * @FilePath: \vue-admin-koa2\vue-admin\src\request\api\article.js
 */
/**
 * 文章管理接口列表
 */
import axios from '@/request/http'; // 导入http中axios封装方法
import qs from 'qs'; // 导入qs模块

export default {
  //新增文章分类名  
  setCategory(params) {
    return axios.post('/articles/setArticleCategory', {
      params: qs.parse(params)
    });
  },

  //文章分类列表   
  articleCategoryList(params) {
    return axios.get('/articles/articleCategoryList', {
      params: qs.parse(params)
    });
  },

  //提交编辑文章分类
  putEditArticleCategory(params) {
    return axios.put('/articles/putArticleCategory', params);
  },

  //删除文章分类
  deleteCategory(params) {
    return axios.delete(`/articles/deleteArticleCategory/${params._id}`);
  },

  //新增文章内容  
  addArticle(params) {
    return axios.post('/articles/addArticle', {
      params: qs.parse(params)
    });
  },

  //文章列表   
  articleList(params) {
    return axios.get('/articles/articleList', {
      params: qs.parse(params)
    });
  },

  //文章详情  
  articleDetail(params) {
    return axios.get(`/articles/articleDetail/${params._id}`);
  },
};
